package com.chen.util;

import java.io.File;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @Author:chenao
 * @DATE:2022/3/3 20:29
 */
@Component
public class UrlUtil {

    @Value("${system.address}")
    private String address;
    @Value("${server.port}")
    private String port;
    @Value("${server.servlet.context-path}")
    private String api;

    public  String createImageUrl(String path,String fileName){
        String imageUrl="";
        imageUrl="http://"+address+":"+port+api+"/"+"img"+"/"+path+"/"+fileName;
        return imageUrl;
    }
}
